import { HydratedDocument } from 'mongoose';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';

export type PaperDocument = HydratedDocument<Paper>;

@Schema()
export class Paper {
  @Prop({ required: true })
  titleName: string;

  @Prop()
  createdTime: Date;

  @Prop()
  updateTime: Date;

  @Prop()
  views: number;

  @Prop({ required: true })
  content: string;

  @Prop()
  desc: string;

  @Prop([String])
  tag: string;
}

export const PaperSchema = SchemaFactory.createForClass(Paper);
